package kr.co.nothingboard.module.board.dao;

import java.util.List;

import kr.co.fish.framework.dao.CustomerDao;
import kr.co.nothingboard.module.board.model.*;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

@Repository
public class BoardDao extends CustomerDao{
	
	public String setBoardRegister(BoardVo vo) throws DataAccessException {
		return (String) insert("board.setBoardRegister", vo);
		
	}
	public int setBoardModify(BoardVo vo) throws DataAccessException {
		return update("board.setBoardModify", vo);
	}
	public int setBoardStateModify(BoardVo vo) throws DataAccessException {
		return update("board.setBoardStateModify", vo);
	}
	public BoardDto getBoard(BoardSearchDto dto) throws DataAccessException {
		return (BoardDto) queryForObject("board.getBoard", dto);
	}
	
	@SuppressWarnings("unchecked")
	public List<BoardDto> getBoardList(BoardSearchDto dto)
			throws DataAccessException {
		return (List<BoardDto>) queryForList("board.getBoardList", dto);
	}

	@SuppressWarnings("unchecked")
	public List<BoardDto> getBoardPageList(BoardSearchDto dto)
			throws DataAccessException {
		return (List<BoardDto>) queryForList("board.getBoardPageList", dto);
	}
}
